const express = require("express")
const router = express.Router()
const handlerFn = require('./handler/articleCate')
const expressJoi = require('@escook/express-joi')
const { reg_addArticle, reg_delArticle } = require('../schema/article')

// 获取文章分类
router.get('/getCate', handlerFn.handlerArticleCate)

// 新增/更新文章分类
router.post('/addOrUpdate/cate/:id?', expressJoi(reg_addArticle), handlerFn.handlerAddArticleCate)

// 删除文章分类
router.post('/del/cate/:id', expressJoi(reg_delArticle),handlerFn.handlerDelArticleCate)

// 根据id获取分类
router.get('/get/cate/:id', expressJoi(reg_delArticle),handlerFn.handlerGetArticleCateById)

module.exports = router
